<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no,viewport-fit=cover">
		<title>通过手机找回</title>
		<link rel="stylesheet" href="../../css/mui.min.css">
		<link rel="stylesheet" href="../../css/app.css">
		<style>
			body{background: #fff;}
			input[type=text]{border: none;border-bottom: 1px solid #e2e2e2;}
			.save{width: 6rem;height: 0.68rem;background: #117afd;font-size: 0.3rem;color: #fff;border: none;outline: none;position: absolute !important;top:5.2rem  !important;left: 0.75rem !important;border-radius: 0.1rem;}
			.info{width: 100%;height: 2.54rem;position: absolute;left: 0;border-bottom: 1px solid #e2e2e2;text-align: center;line-height: 0.54rem;color: #666666;font-size: 0.28rem;padding-top: 0.6rem;}
			.tel,.key,.psd{width: 100%;height: 0.8rem;position: absolute;top: 1.84rem;left: 0;border: none;border-bottom: 1px solid #e2e2e2;padding-left: 0.36rem;font-size: 0.26rem;}
			input::-webkit-input-placeholder{font-size: 0.26rem;color: #999999;}
			.key{top:2.66rem;}
			.psd{top:3.56rem;}
			.submit{width: 1.85rem !important;height: 0.58rem !important;background: #117afd !important;font-size: 0.24rem !important;color: #fff !important;position: absolute !important;top: 2.75rem !important;right: 0.4rem !important;}
			.recover_psd{color: #333333;width: 90%;height: 0.38rem;position: absolute;top:3.69rem; font-size: 0.28rem;background: #fff;text-align: center;left: 0.4rem;}
		</style>
	</head>
	<body>
		<!--<div class="mui-bar mui-bar-nav">
			<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
			<a class="back">返回</a>
			<h1 class="mui-title">绑定手机</h1>
		</div>-->
		<div class="info">您正在为账号<span id="userName"></span>找回密码<br>
		已发送短信验证码至手机号为<span id="phone"></span> ，将收到的短信验证码输入到下面的输入框中</div>
		<!--<input type="text" name="" id="phone" value="" class="tel" placeholder="请输入11位手机号码" />-->
		<input type="text" name="" id="confirm" value="" class="key" placeholder="请输入验证码" />
		<div class="recover_psd">未收到短信验证码，请点击<a>重新发送验证码</a></div>
		<button class="save">下一步</button>
	</body>
	<script src="../../js/mui.min.js"></script>
	<script src="../../js/common.js"></script>
	<script>
		var checkCode = '';
		var loginUserName = '';
		var phone = '';
		mui.plusReady(function(){
			loginUserName = utils.getUrlParam('loginUserName');
			phone = utils.getUrlParam('phone');
			checkCode = utils.getUrlParam('checkCode');
			var zdht = utils.getUrlParam('zdht');
			if(zdht != undefined && zdht == '0'){
				document.getElementById('confirm').value = checkCode;
			}
			document.getElementById('userName').innerHTML = loginUserName?loginUserName.substr(0,2)+'***':'';
			document.getElementById('phone').innerHTML = phone?phone.substr(0,3)+'***'+phone.substr(7,4):'';
			closeWaitingAndShowView();
		})
		//重新发送验证码
		document.querySelector('.recover_psd a').addEventListener('tap',function(){
			//发送验证码
			utils.ajax('appHttpService/appSendPhone.do',function(data){
				var data = JSON.parse(data);
				if(data.code == '0') {//成功
					mui.toast('验证码已发送, 请注意查收！');
					checkCode = data.result;
					if(data.zdht != undefined && data.zdht == '0'){
						document.getElementById('confirm').value = data.result;
					}
				} else {
					mui.toast(data.result);
				}
			},"netUserPhone="+phone,null,function(){
				mui.toast('抱歉，当前服务不可用，请稍后再试！');
			});
			
		});
		document.querySelector('.save').addEventListener('tap',function(){
			var confirmNum = document.getElementById('confirm').value;
			if (confirmNum != checkCode) {
				mui.toast('验证码不正确！');
				return;
			}
			location.href = 'recoverPassword3.html?loginUserName='+loginUserName;
		})
	</script>
</html>